package com.cloudcross.ssp.service.impl;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.cloudcross.ssp.base.dao.GenericIBatisDao;
import com.cloudcross.ssp.common.utils.Pager;
import com.cloudcross.ssp.model.rpt.OsRpt;
import com.cloudcross.ssp.model.rpt.Report;
import com.cloudcross.ssp.service.IRptOsService;

@Service
public class RptOsService implements IRptOsService {

	@Autowired
	private GenericIBatisDao myBatisDao;
	
	@Override
	public List<OsRpt> queryOsDataByCondition(Map<String, Object> condition, Pager pager) {
		String namespace = "";
		if (pager == null) {
			namespace = "rptSqlMapper.queryOsExcelByCondition";
		} else {
			condition.put("pager", pager);
			namespace = "rptSqlMapper.queryOsByCondition";
		}
		return myBatisDao.getList(namespace, condition);
	}

	@Override
	public int queryOsCountByCondition(Map<String, Object> condition) {
		return myBatisDao.get("rptSqlMapper.queryOsCountByCondition", condition);
	}

	@Override
	public Report queryOsTotalByCondition(Map<String, Object> condition) {
		return myBatisDao.get("rptSqlMapper.queryOsTotalByCondition", condition);
	}

	
}
